<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>
<body>
<nav th:replace="layouts::navbar"></nav>

<div class="container">
    <div class="logo"></div>
    <hr>
<h3>当前商品类别</h3>
    <br>
    <a th:href="@{/kinds/new}" class="btn btn-primary btn-sm mb-3">新增类型</a>
    <br>
<table class="table table-bordered table-striped">
    <thead class="thead-dark">
    <tr>
        <th>商品类型</th>
        <th>商品描述</th>
        <th>活动</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="aKind : ${kinds}">
        <td th:text="${aKind.type}"></td>
        <td th:text="${aKind.description}"></td>
        <td>
            <a th:href="@{/kinds/update(id=${aKind.kindId})}" class="btn btn-info btn-sm">更新</a>
            <a
                    th:href="@{/kinds/delete(id=${aKind.kindId})}"
                    class="btn btn-danger btn-sm"
                    onclick="if(!(confirm('你确定删除这个商品吗'))) return false"
            >删除</a>
        </td>
    </tr>
    </tbody>
</table>
</div>
</body>
</html>